package com.caishi.lkx.user.ienum.type;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * @author by keray date:2019/8/1 14:20 用户账号类型
 */
public enum UserAccountType {
    //
    username("用户名登录", 3, "usernameLoginService", "memberService"),
    phone("手机号", 4, "phoneLoginService", "memberService"),
    group("机构登录", 5, "groupLoginService", "memberService"),
    weixin("微信", 6, "weixinLoginService", "memberService"),
    qq("qq", 7, "qqLoginService", "memberService"),
    iphone("苹果登录", 8, "iphoneLoginService", "memberService"),
    wxcx("微信小程序", 9, "wxcxLoginService", "memberService"),
    scan("考研扫码登录", 9, "scanLoginService", "memberService"),
    wxQRcode("微信二维码登录", 10, "wxcxLoginService", "memberService"),
    carsi("carsi登录", 11, "carsiLoginService", "memberService"),
    orgLogin("第三方登录", 12, "orgLoginService", "memberService"),
    ;

    @Getter
    final String desc;

    @EnumValue
    @Getter
    final Integer code;

    @Getter
    final String loginBeanName;

    @Getter
    final String serviceName;

    UserAccountType(String desc, Integer code, String loginBeanName, String serviceName) {
        this.desc = desc;
        this.code = code;
        this.loginBeanName = loginBeanName;
        this.serviceName = serviceName;
    }



    public static boolean isThirdLogin(UserAccountType type) {
        return type == weixin || type == qq || type == iphone || type == wxcx || type == scan || type == carsi;
    }
}
